/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package extracao;
import java.util.ArrayList;
import java.util.Scanner;
/**
 *
 * @author Gustavo & Rodrigo
 */
public class JavaApplication1 {

    private int ano, codigo;
    private String prefixo;
    
    
    
    //String URL = "http://www.dac.unicamp.br/sistemas/catalogos/grad/catalogo" + [ano] + "/ementas/todas" + [prefixo] + ".html#" + [prefixo] + [codigo];
    
    //Document doc = Jsoup.connect("http://example.com/").get();
    
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner leitor = new Scanner(System.in);
        Interface inter = new Interface();
                
        
        System.out.println("Digite o ano do catalogo : ");
        int ano = leitor.nextInt();
                     
        System.out.println("Digite o código da disciplina: ");
        String cod = leitor.next();
        
        Disciplina dis = inter.Requisicao(cod, ano);
        
        if (dis != null) {
            if( dis.getNome() != null){
               System.out.println("Nome: " + dis.getNome());
                System.out.println(dis.getEmenta());
                System.out.println(dis.getCargaHoraria());
                System.out.println(dis.getPreReq()); 
                ArrayList<Disciplina> test = dis.getPreq();
                Disciplina t;
                for (int i = 0; i < test.size(); i++) {
                    t = test.get(i);
                    System.out.println(t.getCodigo() + " - familia: " + t.getFamilia() );
                }
            }
                           
                
            
        } 
    }
             
}
    


